from likeshop_api_project.api.login_api import login_model
from likeshop_api_project.base.myBase import Tools


class celected_cart_model(Tools):
    path = '/api/cart/selected'

    def celected_cart_action(self, cart_id, selected, hd):
        mydata = {
            "cart_id": cart_id,
            "selected": selected
        }
        print(self.hosturl + self.path)
        celected_cart = self.huihua.post(url=self.hosturl + self.path, data=mydata, headers=hd)
        return celected_cart.json()


# import requests
#
# s = requests.session()
# login = login_model(huihua=s)
# msg = login.login_action(account='17612345678', pwd='admin123', client='4')
# print(msg)
# tokena = msg['data']['token']
# hd = {
#     'token': tokena
# }
# print(hd)
# celected_cart = celected_cart_model(huihua=s)
#
# msg2 = celected_cart.celected_cart_action(cart_id=279, selected=1, hd=hd)
# print(msg2)